<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AlterTypeIsForeignToAppTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('app', function (Blueprint $table) {
            //alter type
            $table->tinyInteger('type')->comment('类型:核心应用、重要应用、一般应用')->after('uet')->default(0);
            $table->tinyInteger('is_foreign')->comment('是否对外:只对内、只对外、内外都有')->after('type')->default(0);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('app', function (Blueprint $table) {
            //tinyInteger can not change so to delete
            $table->dropColumn('type');
            $table->dropColumn('is_foreign');
        });
    }
}
